package top.lidee.module.clientApi.twice.applet;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import top.lidee.common.service.twice.applet.StoreIndexService;
import top.lidee.framework.result.ResponseResult;

import java.util.Map;

/**
 * @author 张一恒
 * @version 1.0
 * @description: 店铺首页
 * @date 2024/10/22 14:32
 */
@Api(tags="小程序端-店铺首页")
@RestController
@AllArgsConstructor
@RequestMapping(value = "/applet/store/index")
public class StoreIndexController {

    private final StoreIndexService storeIndexService;

    /**
     * 根据分类id查询店铺信息 分页
     */
    @RequestMapping(value = "/conditionalQueries", method = RequestMethod.POST)
    @ApiOperation(value = "根据分类id查询店铺信息 分页")
    public ResponseResult conditionalQueries(@RequestBody Map<String, Object> params) {
        ResponseResult responseResult = storeIndexService.conditionalQueries(params);
        return responseResult;
    }

    /**
     * 搜索栏：根据店铺标题(名)/地址,模糊搜索分页
     */
    @RequestMapping(value = "/conditionalLikeQueries", method = RequestMethod.POST)
    @ApiOperation(value = "搜索栏：根据店铺标题(名)/地址,模糊搜索分页")
    public ResponseResult conditionalLikeQueries(@RequestBody Map<String, Object> params) {
        ResponseResult responseResult = storeIndexService.conditionalLikeQueries(params);
        return responseResult;
    }

    /**
     * 点击店铺，查询商品
     */
    @RequestMapping(value = "/getInfoAShopListByStoreId/{storeId}", method = RequestMethod.GET)
    @ApiOperation(value = "点击店铺，查询商品")
    public ResponseResult getInfoAShopListByMerchantsId(@PathVariable("storeId") Integer storeId) {
        ResponseResult responseResult = storeIndexService.getInfoAShopListByMerchantsId(storeId);
        return responseResult;
    }




}
